package edu.predatorwars.shared.models;

import java.util.List;
import java.util.UUID;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;

/**
 * Class that wraps the message payload to clients
 */
public class BoardPayload extends Message {

	private Board board;
	private List<Player> playerList;
	private Player whoseTurn;
	private UUID boardSnapshot;
	
	@JsonCreator
	public BoardPayload(@JsonProperty("board") Board board, @JsonProperty("playerList") List<Player> playerList, 
			@JsonProperty("whoseTurn") Player whoseTurn, @JsonProperty("gameId") UUID gameId,
			@JsonProperty("boardSnapshot") UUID boardSnapshot) {
		super(gameId, MessageType.BoardChange);
		this.board = board;
		this.playerList = playerList;
		this.whoseTurn = whoseTurn;
		this.boardSnapshot = boardSnapshot;
	}
	
	//No setters, message payload should be same for all clients each time it's created new
	
	public Board getBoard() {
		return board;
	}
	
	public List<Player> getPlayerList() {
		return playerList;
	}
	
	public Player getWhoseTurn() {
		return whoseTurn;
	}
	
	public UUID getBoardSnapshot() {
		return boardSnapshot;
	}
}
